<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>

    var currentIndex = 5

    // 方法一:
    // currentIndex = currentIndex + 1

    // // 方法二:
    // currentIndex += 1

    // 方法三: 自增
    currentIndex++
    console.log(currentIndex)

    // 自减
    // currentIndex -= 1
    currentIndex--
    console.log(currentIndex)

  </script>

</body>
</html>